package com.alcargo.tools.sample;

public class ChineseCut {



	public static String subString(String str, int cut) {
		if(str.getBytes().length<cut){
			cut= str.getBytes().length;
		}else if(cut<0){
			cut=0;
		}
		char[] temp = str.toCharArray();
		for(int i  = 0 ; i < cut ; i ++){
			byte[] b =  (""+temp[i]).getBytes();
			if(b.length>1){
				cut--;
			}
		}
		return str.substring(0,cut);
	}
	public static void main(String arg[]){
		int a = 1;
		int b = 2;
		
		a=a+b;
		b=a-b;
		a=a-b;
		
		System.out.println(a+"|"+b);
		
	}

}
